package com.mashibing.singleton;

/**
 * 静态内部类(完美)
 * JVM保证单例
 * 加载外部类是不会加载内部类，这样可以实现懒加载
 */
public class Mgro6 {
    private Mgro6() {
    }

    ;

    private static class Mgr07Holder {
        private final static Mgro6 INSTANCE = new Mgro6();
    }

    public static Mgro6 getInstance() {
        return Mgr07Holder.INSTANCE;
    }

    public void m() {
        System.out.println("m");
    }

    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            new Thread(() -> {
                System.out.println(Mgro5.getInstance().hashCode());
            }).start();
        }
    }
}